<?php
namespace app\common\validate;

use think\Validate;

class Rule extends Validate{

    protected $rule =   [
        'name'       => 'require|chsDash',
        'sort'      => 'require|number',
        'hidden'    => 'require',
        'status'    => 'require',
    ];

    protected $message  =   [
        'name.require'          => 'ERR_MISSING_NAME',
        'name.chsDash'          => 'ERR_NAME_TYPE_FORMAT',
        'sort.require'          =>'ERR_MISSING_SORT',
        'sort.num'              =>'ERR_NUM_TYPE_FORMAT',
        'hidden.require'        =>'ERR_MISSING_HIDDEN',
        'status.require'        =>'ERR_MISSING_STATUS',
    ];

    protected $scene = [
        'add'        =>  ['name','sort','hidden','status']
    ];
}